#include<iostream>
using namespace std;

long long int n;
long long int gsl[100001]; //pai xu hou de shu zu
long long int gsll[100001]; //qiao
bool gsout[100001],gsatt[100001];

void att0(int x,int y){ //xu hao
        if((gsl[x] < gsl[y])&&gsatt[y] == 0){
                gsout[x] = 1;
                gsatt[y] = 1;
                return;
        }
}

void sortpp(){
        int count0 = 0;
        for(int i = 0;i < n;i++){
                gsll[gsl[i]]++;
        }
        for(int i = 0;i < 100001;i++){
                if(gsll[i] != 0){
                        for(int j = 0;j < gsll[i];j++){
                                gsl[count0] = i;
                                count0++;
                        }
                }
        }
        return;
}

int main(){
        freopen("duel.in","r",stdin);
        freopen("duel.out","w",stdout);
        cin>>n;
        int count0 = 0,count1 = 0,count2 = 0;
        //yu chu li
        for(int i = 0;i < n;i++) {
                cin>>gsl[i];
                gsout[i] = 0;
                gsatt[i] = 0;
                gsll[i] = 0;
        }
        sortpp();
        gsll[0] = 1;
        for(int i = 0;i < n;i++){
                if(gsl[i] == gsl[i + 1]) {
                        gsll[count0]++;  //ji suan mei ge shu zi chu xian ci shu
                }
                else{
                        count0++;
                        gsll[count0] = 1;
                }
        }
        //jue dou
        for(int i = 1;i < n;i++){
                gsll[count0 + i - 1] = 0;
                if(gsout[i] == 1) continue;
                if(gsl[i] != gsl[i - 1]){
   //                     if(gsatt[i] == 0){
                                count1++;
                                att0(i - 1,i);
   //                     }
                }
               // else if(/*(gsatt[i - 1 + gsll[count1]] == 0)&&*/(i - 1 + gsll[count1] <= n)){
                                att0(i - 1,i - 1 + gsll[count1]);
               // }
        }
        //shu chu
        for(int i = 0;i < n;i++) {
                if(gsout[i] == 0) count2++;
        }
        cout<<count2;


        return 0;
}
